package com.blb.zycommunity.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zycommunity.entity.ZyOwner;
import com.blb.zycommunity.entity.ZyOwnerRoom;
import com.blb.zycommunity.mapper.ZyOwnerRoomMapper;
import com.blb.zycommunity.service.IZyOwnerRoomService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 房屋绑定表  服务实现类
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
@Service
public class ZyOwnerRoomServiceImpl extends ServiceImpl<ZyOwnerRoomMapper, ZyOwnerRoom> implements IZyOwnerRoomService {

    @Autowired
    private ZyOwnerRoomMapper ownerRoomMapper;
    @Override
    public void removeZyOwnerRoom(String ownerId,String roomId) {
        ownerRoomMapper.deleteZyOwnerRoom(ownerId,roomId);
    }

    @Override
    public List<ZyOwnerRoom> findAll() {
        return ownerRoomMapper.selectAllList();
    }

    @Override
    public void updatePass(String ownerRoomId) {
        ownerRoomMapper.updatePass(ownerRoomId);
    }
    @Override
    public IPage<ZyOwnerRoom> findOwnerReviewPage(Long current, Long size, String communityId, String roomStatus) {
        return ownerRoomMapper.selectOwnerReviewPage(new Page<>(current,size),communityId,roomStatus);
    }
    @Override
    public void updateNotPass(String ownerRoomId) {
        ownerRoomMapper.updateNotPass(ownerRoomId);
    }

    @Override
    public List<ZyOwnerRoom> findByOwnerId(String ownerId) {
        return ownerRoomMapper.selectByOwnerIdZyOwnerRooms(ownerId);
    }
}
